#ifndef _SGP30_H_
#define _SGP30_H_
#include "system.h"
#include "init.h"
#define SGP30_ADDRESS 0x58
#define CMD_HINGH 0x20
#define INIT_AIR_QUALITY 0x03
#define MEASURE_AIR_QUALITY 0x08
#define GET_BASELINE 0x15
#define SET_BASELINE 0x1e
#define MEASURE_TEST 0x32
#define GET_FEATURE_SET_VERSION 0x2f
#define MEASURE_RAW_SIGNALS 0x50
typedef void(*pSgp30Init)(void);
typedef void(*PSgp30GetValue)(u32 *,u32 *);
typedef void (*pSgp30EndInit)(void);
typedef struct 
{
    /* data */
    pSgp30Init Psgp30Init;
    PSgp30GetValue Psgp30GetValue;
    pSgp30EndInit Psgp30EndInit;
}sgp30_t;

sgp30_t *sgp30Create(void);
#if ELECT
void sgp30_init(void);
void sgp30_get_value(u32 *co2, u32 *tvoc);
void sgp30_end_init(void);
#endif
#endif
